package org.capybara.coffeehouse.action;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;
import org.capybara.coffeehouse.command.Command;

public class CommandListAction implements Action {
	
	Logger log = Logger.getLogger(CommandListAction.class.getName());
	
	private List<Command> commands = new ArrayList<>();

	@Override
	public void execute() {
		log.info("executing commands...");
		for (Command command : getCommands()) {
			log.info("executing command: "+command);
			command.execute();
		}
	}

	public List<Command> getCommands() {
		return commands;
	}

	public void setCommands(List<Command> commands) {
		this.commands = commands;
	}
	
	
}
